import http from '../http/index.js'

// 热门项目
export const popular = (page) => {
	if (!page ) page = 1
	return http.request({
		url : 'v3/projects/popular',
		method : 'GET',
		data : {page : page}
	})
}

// 最近更新
export const latest = (page) => {
	if (!page ) page = 1
	return http.request({
		url : 'v3/projects/latest',
		method : 'GET',
		data : {page : page}
	})
}

// 推荐项目
export const featured = (page) => {
	if (!page ) page = 1
	return http.request({
		url : 'v3/projects/featured',
		method : 'GET',
		data : {page : page}
	})
}

// 语言列表
export const languages = () => {
	return http.get('v3/projects/languages')
}

// 某语言下的项目
export const lan_projects = (lan_id,page) => {
	if (!page) page = 1
	return http.get('v3/projects/languages/'+ lan_id + '?page='+page)
}

